import request from './request.js';
let service = request.service;
let download = request.download;
export default {
    loginOut() {
        return service({
            url: `/adscm/logout`, //退出登录
            method: 'get'
        })
    },
     idImgUpload() {
         /**拍照图片上传 */
         return '/adscm/operation/filesystem/upload'
     },
    uploadImg(url,data) {
        return service({
            url: url,
            method: 'post',
            data
        }, 'upload')
    },
    deleteImgUrl(data) {
    return service({
        url: `/adscm/operation/filesystem/deleteImage`,
        method: 'post',
        data
    })
    },
    taskManagerAttchmentDownload(id) { //原文献下载
        return download({
            url: `/adscm/operation/taskManagerAttchment/download/${id}`
        })
    },
    menuPermissions(menuId){/**获取菜单权限 */
        return service({
            url: `/adscm/system/menu/getMenuAllSrc/${menuId}`,
            method: 'post'
        })
    },
    imgUpload() {
        /**图片上传 */
        return download({
            url: '/adscm/operation/filesystem/upload'
        })
    },
    changePassword(userId, password) {
        /**修改密码 */
        return service({
           url: `/adscm/system/user/editUsersPwd/${userId}/${password}`,
           method: 'post'
       })
    },
    /**获取所有用户列表 */
    getAllUsers(){
        return service({
            url: `/adscm/system/user/selectAllUser`,
            method: 'get'
        })
    },
     /**根据用户tokenId获取用户菜单 */
     getMenuByUser() {
        return service({
             url: `/adscm/system/menu/getUsersSrc`,
             method: 'get'
         })
     },
     /**图片上传 公共接口*/
    publicImgLoad() {
        return download({
            url: '/adscm/operation/upload'
        })
    },
    publicImageDownload(data) {
       return service({
           url: `/adscm/operation/download`,
           method: 'post',
           data
       })
    }
}
